package com.wzqj.agent.util;

import com.alibaba.fastjson.JSONObject;
import com.wzqj.agent.common.ConfigHelper;
import com.wzqj.agent.common.SoaConfig;
import com.wzqj.wsp.response.ResponseValue;
import com.wzqj.wsp.response.ResultStatus;
import com.wzqj.wsp.soa.SOAUtil;

/** 
 * date: 2015年6月13日 下午1:29:39 
 * @author liuhongyu
 */
public class SmsSOA {

	private static String WPP_PROVIDER_APP_CODE = ConfigHelper.getProperty("WPP_PROVIDER_APP_CODE");
	
	private static final String send_sms_uri = "soa/sendSms";
	
	public static boolean sendSms(String phone, String content){
		boolean ret = false;
        JSONObject soaParam = SoaConfig.getSoaParam();
		JSONObject params = new JSONObject();
		params.put("phone", phone);
		params.put("content", content);
        ResponseValue smsRet = SOAUtil.getResValFromSOA(WPP_PROVIDER_APP_CODE, send_sms_uri, params,soaParam);
		if(smsRet != null && smsRet.getStatus() == ResultStatus.SUCCESS_STATUS){
			ret = true;
		}
		
		return ret;
	}
}
